package com.offcn.dongyimai.common.utils;

/**
 * @author Administrator
 * @date 2021/7/29 16:27
 * @description
 **/

/**
 * 返回结果集
 * @param <T>
 */
public class Result<T> {

    private boolean flag;       // 是否请求成功

    private Integer code;       // 响应状态码

    private String message;     // 返回信息

    private T data;             // 返回数据

    public Result(boolean flag, Integer code, String message, T data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result(boolean flag, Integer code, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    public Result(boolean flag, Integer code) {
        this.flag = flag;
        this.code = code;
        //this.message = "操作成功";
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
